package com.yj.timecapsule.mapper;

import com.yj.timecapsule.entity.user.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MessageMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Message record);

    int insertSelective(Message record);

    Message selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Message record);

    int updateByPrimaryKey(Message record);

    void insertBatch(@Param("list") List<Message> messageList);

    int deleteBySenderIdAndReceiverId(@Param("senderId") Long userId, @Param("receiverId") Long targetId);

    void deleteByIds(@Param("ids") List<Long> ids);

    List<Message> selectBySenderIdAndReceiverId(@Param("senderId") Long senderId, @Param("receiverId") Long targetId);

    List<Message> selectAllBySenderIdOrReceiverId(@Param("senderId") Long senderId, @Param("receiverId") Long targetId);
}